package com.example.imchat.model.dao;

import android.content.Context;

import com.example.imchat.model.db.DBHelper;

/*
* 联系人和邀请的管理类
* */
public class DBManager {
    private final DBHelper dbHelper;
    private final ContactTableDao contactTableDao;
    private final InviteTableDao InviteTableDao;

    public DBManager(Context context,String name) {
        //创建数据库
        dbHelper = new DBHelper(context,name);

        //创建数据库中两张表的操作
         contactTableDao = new ContactTableDao(dbHelper);
         InviteTableDao = new InviteTableDao(dbHelper);

    }
    //获取联系人操作对象
    public ContactTableDao getContactTableDao(){
        return contactTableDao;
    }

    //获取邀请信息表操作对象
    public InviteTableDao getInviteTableDao(){
        return InviteTableDao;
    }

    public void close() {
        dbHelper.close();
    }
}
